"""mywebsite1 URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import re_path
from . import views

urlpatterns = [
    # 自上而下匹配，如果前面匹配到了，就不要继续向下匹配
    re_path(r'admin/', admin.site.urls),
    re_path(r'^page1$', views.page1),
    re_path(r'page2', views.page2),
    re_path(r'^$', views.home_page),
    re_path(r'^year/(\d{4})$', views.page_year),
    re_path(r'^birthday/(\d{4})/(\d{1,2})/(\d{1,2})$', views.birthday),
    # 使用关键字传参
    re_path(r'^person/(?P<n     ame>\w+)/(?P<age>\d+)$', views.person),
    re_path(r'^(\d+)/sub/(\d+)$', views.sub),
    re_path(r'^(\d+)/add/(\d+)$', views.add),
    re_path(r'^test$', views.test_request),
    re_path(r'^test2$', views.test_request2),
    re_path(r'^test_get$', views.test_get),
    re_path(r'^birthday2', views.birthday2),
    re_path(r'^search$', views.search),
    re_path(r'^shebao$', views.shebao),

]
